package model.persistence.daos;

import java.util.Collection;

import org.hibernate.Criteria;
import org.hibernate.Session;

import model.entities.Local;
import model.persistence.HibernateSessionFactory;

public class LocalDAO extends GenericDAO
{

	@SuppressWarnings("unchecked")
	public static Collection<Local> getAll() {
		Session session = HibernateSessionFactory.getSessionFactory().openSession();
	     Criteria c = session.createCriteria(Local.class);  
	     return c.list();
	}
	
	public static Object getById(int id)
	{
		Session session = HibernateSessionFactory.getSessionFactory().openSession();
		return session.load(Local.class, id);
	}
	

}
